﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;

namespace FerrSimplicity
{
    /// <summary>
    /// This component registers the game object with the ManagerCamera, allowing you
    /// to treat it as a focus point for your view!
    /// </summary>
    public class ComCamera : BaseComponent
    {
        #region Properties
        /// <summary>
        /// Name of the camera
        /// </summary>
        public string Name { get; set; }
        #endregion

        #region Constructor
        /// <summary>
        /// A default parameterless constructor for use with cloning
        /// </summary>
        public ComCamera()
            :this(""){}
        /// <summary>
        /// Basic constructor, this camera doesn't do much, besides register itself with the ManagerCamera
        /// override it to add extra functionality, or just add more components!
        /// </summary>
        /// <param name="aName"></param>
        public ComCamera(string aName)
        {
            Name = aName;
        }
        #endregion

        #region Overrides
        public override void Enable(bool aEnableValue)
        {
            // we want to register ourselves with the manager on enable, and unregister on disable
            if (aEnableValue)
                ManagerCameras.Instance.RegisterCamera(this);
            else
                ManagerCameras.Instance.UnregisterCamera(this);

            base.Enable(aEnableValue);
        }
        #endregion
    }
}
